package com.Tjise.opp.duotai;

public class Student extends Person {
    // 属性
    private String stuNum;
    private double stuScore;

    // 行为


    public Student() {
        System.out.println("执行了子类Student类的默认的构造方法...");
    }

    public Student(String perName, int perAge, String perSex, String stuNum, double stuScore) {
        super(perName, perAge, perSex); // 使用super调用了父类的构造方法，必须放在第一行
        System.out.println("执行了子类Student类的自定义的构造方法...");
        this.stuNum = stuNum;
        this.stuScore = stuScore;
    }

    public String getStuNum() {
        return stuNum;
    }

    public void setStuNum(String stuNum) {
        this.stuNum = stuNum;
    }

    public double getStuScore() {
        return stuScore;
    }

    public void setStuScore(double stuScore) {
        this.stuScore = stuScore;
    }

    /**
     * 子类新创建的行为：学习
     */
    public void doStuding() {
        System.out.println("I am studing...");
    }

    @Override
    public void doEating() {
        // 使用super调用父类的行为方法
        super.doEating();
        // 子类覆盖父类
        System.out.println("student is eating...");
    }


}
